#ifndef SL_RENDERTEXTUREMANAGER_HPP
#define SL_RENDERTEXTUREMANAGER_HPP

// SFML Header
#include <SFML/Window.hpp>

// Eigene Header
#include "../System/Lua.hpp"
#include "ManagerTemplate.hpp"
#include "../Window/RenderScreen.hpp"
#include "../System/Code.hpp"
#include "../System/Exception.hpp"

namespace sl
{
	namespace tmp
	{
		class RenderTextureManagerS : public Singleton<RenderTextureManagerS>, public ManagerPointer<sf::RenderTexture>
		{
		friend class Singleton<RenderTextureManagerS>;
		friend class ManagerTemplate<sf::RenderTexture>;

		public:
			using Singleton<RenderTextureManagerS>::myInstance;

			static RenderTextureManagerS* GetInstance()
			{
				if (!myInstance)
					myInstance = new RenderTextureManagerS();

				return myInstance;
			}

			sf::RenderTexture* Get(const std::string& name);

			sf::RenderTexture* Create(const std::string& name, unsigned int width = RenderScreenS::GetInstance()->GetMode().Width, unsigned int height = RenderScreenS::GetInstance()->GetMode().Height, bool depthBuffer = false);
			RenderTextureManagerS* Clear(const std::string& name, const sf::Color& color = sf::Color::Magenta);
			RenderTextureManagerS* Clear(const sf::Color& color = sf::Color::Magenta);
			RenderTextureManagerS* Display(const std::string& name);
			RenderTextureManagerS* Display();
			RenderTextureManagerS* Draw(const std::string& name, sf::RenderTarget* tar = (*RenderScreen)(), float x = 0.f, float y = 0.f);
			RenderTextureManagerS* Draw(sf::RenderTarget* tar = (*RenderScreen)(), float x = 0.f, float y = 0.f);

			RenderTextureManagerS* SetActive(bool active = true);
			bool IsActive();

		private:
			bool myIsActive;
		};
	}

	#define RenderTextureManager tmp::RenderTextureManagerS::GetInstance()
}

#endif //SL_RENDERIMAGEMANAGER_HPP